package com.usian.feign;

import com.usian.pojo.TbUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;

@FeignClient(value = "usian-sso-service")
public interface SSOFeign {

    @RequestMapping("/checkUserInfo/{checkValue}/{checkFlag}")
    public boolean checkUserInfo(@PathVariable String checkValue,
                                @PathVariable int checkFlag);

    @RequestMapping("userRegister")
    public boolean userRegister(@RequestBody TbUser tbUser);

    @RequestMapping("/userLogin")
    public HashMap userLogin(@RequestParam String username,
                             @RequestParam String password);

    @RequestMapping("/getUserByToken/{token}")
    public boolean getUserByToken(@PathVariable String token);

    @RequestMapping("/logOut")
    public boolean logOut(@RequestParam String token);
}
